
const { add,find } = require('../model/position.add.js')

const positionAddController = {
  add:({req, res}) => {
    req.body.companyLogo = req.fileName
    let result = add({...req.body})
      res.render('position-add',{
        data: result
      })
  },
  find: async({req,res})=>{//用于将接口暴露出去
    // find() == p1
    let result = await find().then( res => res )  //还是
    console.log( result )
    res.render('position-find',{
      data: JSON.stringify(result)
    })
  }
}

module.exports = positionAddController